package light.head.dao.mobile;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import light.head.enm.RESULT;
import light.head.framework.base.BaseDAO;
import light.head.framework.entity.PageBean;
import light.head.model.Announcement;

import org.springframework.stereotype.Service;

/**
 * 公告
 * @author yangguanghe @date 2014-5-28 @time 上午11:20:11
 *
 */
@Service
public class MobileAnnouncementDAO extends BaseDAO<Announcement, Integer> {

	/**
	 * 查询	
	 *@param oc		机构编号
	 *@param map	查询条件
	 *@param pb		分页对象
	 *@author yangguanghe [2014-5-28_上午11:26:14]
	 */
	public RESULT findByMap(Integer oc, Map<String, String> map, PageBean pb) {
		if (null == oc) return null;
		
		StringBuffer hql = new StringBuffer("FROM Announcement a WHERE a.oc = ? and a.edition = 1");
		List<Object> parm = new ArrayList<Object>();
		parm.add(oc);
		
		if (null != map) {
			
		}
		hql.append(" ORDER BY a.code DESC");
		return findToPageBean(hql.toString(), pb, parm);
	}
	
}
